﻿using BigEgg.Framework.Applications.ViewModels;
using FMStudio.Documents.TemplateDocument.Models;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.ComponentModel.Composition;
using System.Xml.Serialization;

namespace FMStudio.Documents.TemplateDocument
{
    [Export(typeof(IDocument)), Export]
    public class ProjectTemplateDocument : TemplateDocument
    {
        #region Fields
        private Project templateContent;
        #endregion

        public ProjectTemplateDocument()
            : base(TemplateType.Project)
        {
            this.templateContent = new Project();

            AddWeakEventListener(this.templateContent, TemplateContentChanged);
        }


        #region Properties
        [XmlElement(Order = 2)]
        public Project TemplateContent 
        { 
            get { return this.templateContent; }
            set { this.templateContent = value; }
        }
        #endregion

        #region Methods
        #region Private Methods
        private void TemplateContentChanged(object sender, PropertyChangedEventArgs e)
        {
            this.IsModified = true;
        }
        #endregion
        #endregion
    }
}
